package API.DAY1;

public class IndexOfDemo {//查询字符串中第一次出现的位置
    public static void main(String[] args) {
        String x = "Hello Word!!!";
        int a = x.indexOf("l");
        System.out.println(a);
        int b = x.indexOf("l",3);
        System.out.println(b);
        int c = x.indexOf("aaaa");
        System.out.println(c);
        int d = x.lastIndexOf("l");
        System.out.println(d);
    }
}
